import {
  createStore
} from 'vuex'

export default createStore({
  state: {
    // 选择的日期距离今天的天数
    days: 0,
    // 是否在学校标志
    isInSchool: false,
    // 驾驶舱数据
    dashBoardData: {
      "clazz": "林学201802",
      "date": "2021-09-17",
      "libraryDay": [
        0,
        5,
        8,
        7,
        9,
        6,
        7
      ],
      "libraryProportion": [{
          "dormitory": "5公寓1单元107",
          "proportion": 0.03
        },
        {
          "dormitory": "5公寓1单元108",
          "proportion": 0.06
        },
        {
          "dormitory": "5公寓1单元109",
          "proportion": 0.06
        },
        {
          "dormitory": "7公寓3单元521",
          "proportion": 0.06
        },
        {
          "dormitory": "7公寓3单元522",
          "proportion": 0.1
        },
        {
          "dormitory": "7公寓3单元601",
          "proportion": 0.06
        },
        {
          "dormitory": "7公寓3单元602",
          "proportion": 0.03
        },
        {
          "dormitory": "7公寓3单元603",
          "proportion": 0.03
        }
      ],
      "absentProportion": 0.05,
      "schoolPopulation": 14,
      "outStayNoAsk": 0,
      "outStayAsk": 1,
      "outStayProportion": [{
          "dormitory": "5公寓1单元107",
          "proportion": 0
        },
        {
          "dormitory": "5公寓1单元108",
          "proportion": 0
        },
        {
          "dormitory": "5公寓1单元109",
          "proportion": 0
        },
        {
          "dormitory": "7公寓3单元521",
          "proportion": 0
        },
        {
          "dormitory": "7公寓3单元522",
          "proportion": 0
        },
        {
          "dormitory": "7公寓3单元601",
          "proportion": 0
        },
        {
          "dormitory": "7公寓3单元602",
          "proportion": 0.23
        },
        {
          "dormitory": "7公寓3单元603",
          "proportion": 0
        }
      ],
      "onlineWeekTime": [{
          "dormitory": "5公寓1单元107",
          "time": 9
        },
        {
          "dormitory": "5公寓1单元108",
          "time": 0
        },
        {
          "dormitory": "5公寓1单元109",
          "time": 11
        },
        {
          "dormitory": "7公寓3单元521",
          "time": 20
        },
        {
          "dormitory": "7公寓3单元522",
          "time": 0
        },
        {
          "dormitory": "7公寓3单元601",
          "time": 10
        },
        {
          "dormitory": "7公寓3单元602",
          "time": 4
        },
        {
          "dormitory": "7公寓3单元603",
          "time": 0
        }
      ],
      "onlineNightProportion": 0.91,
      "onlineDayPopulation": [{
          "dormitory": "5公寓1单元107",
          "population": [
            2,
            3,
            0,
            1,
            1,
            1,
            0
          ]
        },
        {
          "dormitory": "5公寓1单元108",
          "population": [
            0,
            1,
            1,
            1,
            0,
            0,
            1
          ]
        },
        {
          "dormitory": "5公寓1单元109",
          "population": [
            0,
            1,
            1,
            1,
            1,
            1,
            0
          ]
        },
        {
          "dormitory": "7公寓3单元521",
          "population": [
            2,
            4,
            3,
            4,
            4,
            4,
            4
          ]
        },
        {
          "dormitory": "7公寓3单元522",
          "population": [
            2,
            2,
            1,
            2,
            2,
            2,
            2
          ]
        },
        {
          "dormitory": "7公寓3单元601",
          "population": [
            4,
            5,
            4,
            5,
            4,
            5,
            4
          ]
        },
        {
          "dormitory": "7公寓3单元602",
          "population": [
            1,
            0,
            0,
            1,
            0,
            0,
            1
          ]
        },
        {
          "dormitory": "7公寓3单元603",
          "population": [
            0,
            0,
            0,
            0,
            0,
            0,
            0
          ]
        }
      ]
    },
    // 是否显示图表
    isshowcharts: false,
  },
  mutations: {

    setIsInSchool(state, isInSchool) {
      state.isInSchool = isInSchool
    },
    setDashBoardData(state, dashBoardData) {
      state.dashBoardData = dashBoardData
    },
    setIsShowCharts(state, isshowcharts) {
      state.setIsShowCharts = isshowcharts
    }
  },
  actions: {},
  modules: {}
})